<template>
	<view class="container">
		<view class="content">
			<view class="top-div">
				<view class="success-icon">
					<image src="/static/sj_pay_success.png" class="image" mode="widthFix">
					</image>
				</view>
				<view class="tit">恭喜支付成功</view>
				<uni-list>
					<uni-list-item title="支付方式" right-text="微信支付" class="zffs"></uni-list-item>
					<uni-list-item title="支付金额" :right-text="'¥'+money+'+'+price+'积分'" class="zfje"
						v-if="typeId==1"></uni-list-item>
					<uni-list-item title="支付金额" :right-text="'¥'+money" class="zfje" v-else></uni-list-item>
				</uni-list>
			</view>
			<view class="btn-group">
				<!-- <navigator url="/pages/center/index" open-type="switchTab" class="mix-btn">查看订单</navigator> -->
				<navigator url="/pages/index/index" open-type="switchTab" class="mix-btn  btncss">关闭</navigator>
			</view>
		</view>
	</view>

</template>

<script>
	export default {
		data() {
			return {
				orderId: 0,
				type: 0,
				code: 0,
				payWayText: "积分支付",
				money: 0,
				successText: "",
				payOk: true,
				noMoney: "",
				image: "",
				price: 0,
				typeId: 0
			}
		},
		onLoad(options) {
			this.orderId = options.orderId;
			// this.type = options.type;
			this.code = options.code;
			this.money = options.money;
			this.price = options.price
			this.typeId = options.typeId
			this.image = decodeURIComponent(options.image);
			// if (this.type == 1) {
			// 	this.payWayText = "微信支付";
			// }
			if (this.orderId > 0 && options.typeId == 1) {
				this.payOrder()
			}
		},
		methods: {
			payOrder() {
				this.$public.htmlPost("/api/payOrder", {
					orderId: this.orderId,
					code: this.code
				}).then((res) => {
					console.log("订单积分支付", res)
					// if (res.data.code == 0) {
					// 	this.code = res.data.data.code
					// 	this.money = res.data.data.money
					// 	this.price = res.data.data.integral
					// 	this.successText = "兑换成功，我们将尽快安排发货"
					// 	this.payOk = true
					// } else {
					// 	this.successText = "兑换未成功，当前积分不够 "
					// 	this.payOk = false
					// 	this.money = this.noMoney
					// }
				})
			}
		}
	}
</script>

<style lang='scss' scoped>
	.content {
		/* display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center; */
		text-align: center;
	}

	.image {
		width: 200rpx;
		height: 200rpx;

	}

	.top-div {
		background: #f7f7f7;
		padding-top: 44rpx;
	}

	.success-icon {
		margin-bottom: 45rpx;
	}

	.tit {
		font-size: 28rpx;
		color: #ff0909;
	}

	.titnum {
		color: #ff0909;
		font-size: 32rpx;
		height: 80rpx;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.xiatext {
		color: #ff0909;
		font-size: 28rpx;
		color: #333;
		/* line-height: 2; */

	}

	/deep/.uni-list {
		text-align: left;
		margin-top: 50rpx;

		.uni-list-item {
			background: #f7f7f7;
		}

	}

	.quzhuanjifen {
		background: #f7f7f7;
		height: 207rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		border-top: $uni-wl-bottom-border;
		margin-top: 50rpx;

		.zjf-btn {
			height: 88rpx;
			width: 415rpx;
			display: flex;
			justify-content: center;
			color: #ff1200;
			font-size: 28rpx;
			border: 1px solid #ff1200;
			align-items: center;
			border-radius: 10rpx;
		}
	}

	.btn-group {
		padding-top: 100upx;
	}

	.mix-btn {
		/* margin-top: 30upx; */
		display: flex;
		align-items: center;
		justify-content: center;
		width: 690rpx;
		height: 100rpx;
		font-size: $font-lg;
		color: #fff;
		background-color: $uni-color-warning;
		border-radius: 10upx;
		margin: 30upx auto 0;

		&.hollow {
			background: #fff;
			color: #303133;
			border: 1px solid #ccc;
		}
	}
</style>